package com.szeldon.declatest.declaration.scenario.parts;

/**
 * "If" part of scenario. Consists of:
 * <ul>
 * <li>left - left value</li>
 * <li>operator - operator used for comparison of left and right value</li>
 * <li>left - right value</li>
 * </ul>
 * 
 * @author szeldon
 * 
 */
public class IfPartDeclaration extends ConditionPartDeclaration {

    /**
     * Creates "If" scenario part with left, operator, right and description.
     * 
     * @param left
     * @param operator
     * @param right
     * @param description
     */
    public IfPartDeclaration(String left, String operator, String right, String description) {
        super(left, operator, right, description);
    }

    @Override
    public ScenarioPartsTypeEnum getPartType() {
        return ScenarioPartsTypeEnum.IF_PART;
    }

    @Override
    public boolean isCondition() {
        return true;
    }

    @Override
    public String toString() {
        return "If left=" + left + "; operator=" + operator + "; right=" + right + "; description=" + description + ";";
    }
}
